1. Field of the Invention
The present invention relates to an input image processing apparatus and method. More particularly, it relates to an image processing apparatus for extracting only a selected image data portion from image data inputted from an image input device and processing method therefor.
2. Description of Related Art
Arithmetic processing is often performed on image data inputted from an image input device such as a Charge Coupled Device (CCD) using a Microprocessor (MPU). In many cases, the image data inputted takes the form of an image frame of predetermined size which is captured at a predetermined time interval from the CCD. In image processing, there are some cases that arithmetic processing is performed in the overall area of the image frame, and there are some cases that the processing is performed only in a selected portion of the image frame. When the processing is partially performed, a selected region is usually set on the image frame to extract only the image data portion within the selected region which is stored in an image memory for the partial processing.
FIG. 11 shows an example of an image frame. In FIG. 11, an image frame 60 is assumed to be 8 pixels wide by 6 pixels high for simplification of explanation. DATA (h, v) (h=0 to 7, v=0 to 5) shown in FIG. 11 indicates pixel data. In the figure, h indicates a coordinate in the horizontal scanning direction H, assuming that the pixel on the top left is an origin, and v indicates a coordinate in a vertical scanning direction V. Pixel data is inputted for each line consisting of 8 pixels aligned in the horizontal scanning direction H from the top to bottom in order. Each line consisting of 8 pixels aligned in the horizontal scanning direction H is inputted from left to right in order.
One of methods for fetching pixel data within a selected region 62 defined on the image frame 60 is shown in FIG. 12. An input image processing apparatus 68 shown in FIG. 12 includes two image memories (image memories A and B). The image frame 60 inputted from an image input device 72 is once captured in the image memory A. And then the selected region 62 is set on the image frame 60 within the image memory A to fetch image data portion 64 from the selected region 62 and store the data 64 in the image memory B.
Another method is to set up starting and ending coordinates respectively in the horizontal scanning direction H and the vertical scanning direction V of the image frame 60 and fetch image data from the area determined by its starting and ending coordinates. For example, as shown in FIG. 13(a), the selected region 60 can be specified by setting up starting coordinate Vs and ending coordinate Ve in the vertical scanning direction V, as well as setting up starting coordinate Hs and ending coordinate He in the horizontal scanning direction H on the image frame 60.
A typical method of fetching the pixel data included within the selected region 62 shown in FIG. 13(a) from the image frame 60 inputted from the image input device 72 is to determine the coordinates on the image frame 60 of the pixel data currently inputted and indicate write of the pixel data into another image memory only in the case these coordinates are included in the selected region 62. An example of an input image processing apparatus 80 for performing this method is illustrated in FIG. 14.
The coordinates on the image frame 60 in the pixel data currently inputted can be determined by a horizontal counter 82 and a vertical counter 92. Pixel CLK is an input synchronizing signal, Hsync is a horizontal synchronizing signal and Vsync is a vertical synchronizing signal. The horizontal counter 82 counts the pixel CLK to determine the coordinate h in the horizontal scanning direction H. When the Hsync is inputted, the horizontal counter 82 will be reset. The vertical counter 92 counts the Hsync to determine the coordinate v in the vertical scanning direction V. When the Vsync is inputted, the vertical counter 92 will be reset.
Horizontal direction components Hs and He of the starting and ending coordinates to determine the selected region 62 are stored in a horizontal register 86, and vertical direction components Vs and Ve of the starting and ending coordinates to determine the selected region 62 are stored in a vertical register 96. A comparison is made between the count value Vc of the vertical counter 92 and the values Vs and Ve of the vertical register 96 using a comparator 94, as well as making a comparison between the count value Hc of the horizontal register 82 and the values Hs and He of the horizontal register 86 using the comparator 84. A signal Hcmp indicating whether or not it satisfies Hsxe2x89xa6Hcxe2x89xa6He is sent to a write signal output section 90, and a signal Vcmp indicating whether or not the comparator 94 satisfies Vsxe2x89xa6Vcxe2x89xa6Ve is sent to the write signal output section 90.
When the values are Hsxe2x89xa6Hcxe2x89xa6He and Vsxe2x89xa6Vcxe2x89xa6Ve, the write signal output section 90 instructs an image memory 70 to write the pixel data because the pixel data (DATA (Hc, Vc)) currently inputted is included in the selected region 62. A timing chart of image processing for the pixel data from DATA (1, 6) to DATA (3, 1) when the selected region 62 is defined by 4 points; DATA (2, 3), DATA (2, 6), DATA (4, 3), and DATA (4, 6) as shown in FIG. 13(b) is shown in FIG. 15.
The method for fetching the image data 64 from the selected region 62 under the control of the MPU 74 as shown in FIG. 12 requires two image memories. Further, the necessity for the MPU 74 to once store the image frame 60 in the image memory A and perform software processing increases the load on the MPU 74, which may lead to inability to process a large amount of image data consecutively. In the method of defining the selected region 62 using the starting and ending coordinates as shown in FIG. 13(a), only the rectangle-type selected region 62 can be defined.
It is an object of the present invention to consecutively store in an image memory image data within a selected region of an arbitrary shape provided on an image frame.
The input image processing apparatus of the present invention comprises a region selection memory for storing region selection information for defining a selected region in input image frame, and write indication means for indicating write of pixel data included in the selected region into an image memory based on the region selection information. This image processing apparatus reads the region selection information from the region selection memory. And then the apparatus determines based on the region selection information whether or not the inputted pixel data is included in the selected region, and indicates the write of the pixel data included in the selected region into the image memory.
The image processing method of the present invention includes the steps of determining whether or not input pixel data is included in a selected region in input image frame, and writing the pixel data included in the selected region into an image memory.
According to the input image processing apparatus and the processing method of the present invention, pixel data within a selected region defined on an image frame can be consecutively stored in an image memory. When the image frame is composed of a plurality of subframes, inputted by a plurality of image input devices, the pixel data within a selected region defined on the image frame can be successively stored in the image memory as well.